package com.jt.controller;
//第四步：基于feign方式访问--远端服务调用(前提是服务必须存在)
import com.jt.feign.RemoteProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer/")
public class FeignConsumerController {
    @Autowired//注入接口
    private RemoteProviderService remoteProviderService;
    //响应网址 http://localhost:8090/consumer/get/abcd
    @GetMapping("get/{msg}") /**基于feign方式的服务调用*/
    public String doFeignEcho(@PathVariable String msg){
        return remoteProviderService.echoMessage(msg);
    }
}